package MyArray;

import java.util.Arrays;

/**把数组的元素内容反转
 * arr {11,22,33,44,55,66} {66, 55,44,33,22,11}
 * @author Raymond
 * @create 2025/2/26 11:09
 */
public class ArrayReverse {
    public static void main(String[] args) {
        int[] arr = {11,22,33,44,55};
        for (int i = 0; i < arr.length / 2; i++) {
            int tmp = arr[i];
            arr[i] = arr[arr.length-i-1];
            arr[arr.length-i-1]=tmp;
        }
        System.out.println("arr = " + Arrays.toString(arr));
    }
}
